package com.ciaojian.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ciaojian.core.model.StorePerformance;
import com.ciaojian.core.model.vo.StoreCounponNumVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 门店销售额 Mapper 接口
 * </p>
 *
 * @author Atlakyn
 * @since 2021-04-27
 */
public interface StorePerformanceMapper extends BaseMapper<StorePerformance> {
    /**
     * 月份营收
     *
     * @param storeId 门店Id
     * @param month   月份
     * @return 月份营收数据
     */
    List<Map<String, String>> performanceOfMonth(@Param("storeId") Integer storeId, @Param("month") Date month);

    /**
     * 查询门店业绩数据
     *
     * @param storeId 门店Id
     * @return 门店
     */
    List<Map<String, String>> performanceData(@Param("storeId") Integer storeId);

    /**
     * 查询美团和次卡订单业绩
     *
     * @param storeId 门店 Id
     * @param date    日期
     * @return 美团和次卡订单业绩
     */
    Map<String, String> performanceMeituanAndCika(@Param("storeId") Integer storeId, @Param("date") String date);

    int firstMemberNum(@Param("storeId") Integer storeId, @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("workerId") Integer workerId);


    List<StoreCounponNumVo> storeExistCouponNum();
}
